using OpenAiClient.Tools;

namespace OpenAiClient.Services
{
    /// <summary>
    /// 日志服务
    /// </summary>
    public class LogService : ILogService
    {
        /// <summary>
        /// 启动日志模块
        /// </summary>
        /// <param name="configFile">配置文件路径</param>
        public void Startup(string configFile)
        {
            LogHelper.Startup(configFile);
            LogHelper.Info(@"Instance startup.");
        }

        /// <summary>
        /// 关闭日志模块
        /// </summary>
        public void Shutdown()
        {
            LogHelper.Info(@"Instance shutdown.");
            LogHelper.Shutdown();
        }

        #region 添加日志

        public void Trace(string message)
        {
            LogHelper.Trace(message);
        }

        public void Debug(string message)
        {
            LogHelper.Debug(message);
        }

        public void Info(string message)
        {
            LogHelper.Info(message);
        }

        public void Warn(string message)
        {
            LogHelper.Warn(message);
        }

        public void Error(string message)
        {
            LogHelper.Error(message);
        }

        public void Fatal(string message)
        {
            LogHelper.Fatal(message);
        }

        #endregion
    }
}
